package cn.well.cloud.modular.mapper;

import cn.well.cloud.modular.model.NoticeLog;
import cn.well.cloud.modular.model.UserInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 课程通知记录 Mapper 接口
 * </p>
 *
 * @author jiawei
 * @since 2020-06-04
 */
public interface NoticeLogMapper extends BaseMapper<NoticeLog> {

    /**
     * 查询课程通知记录，关联课程，用户
     * @param courseId
     * @param wxType
     * @return
     */
    IPage<Map<String,Object>> pageMapsInfos(Page page, @Param("courseId")String courseId, @Param("wxType")String wxType,@Param("searchName")String searchName);

    /**
     * 根据课程id,微信类型,模板id查询还未推送过通知的用户集
     * @param courseId
     * @param wxType
     * @param templateId
     * @return
     */
    List<UserInfo> getUnUserNoticeLogMap(@Param("courseId")Long courseId, @Param("wxType") String wxType, @Param("templateId") String templateId);
}
